// pages/order/myorder/myorder.js
Page({

	/**
	 * 页面的初始数据
	 */
	data: {
		orderList: [],
		orderState : ['完成','送餐中','打包中']
	},

	onLoad: function () {
		this.readOrderList();
	},

	onPullDownRefresh: function () {
		this.readOrderList();
	},

	/***********************************自定义方法************************************* */
	readOrderList(){
		wx.showLoading({title:'加载订单...'})
		wx.request({
			url: 'http://127.0.0.1:7080/orderlist',
			header: {
				'Content-Type': 'application/json'
			},
			success: (res) => {
				this.setData({orderList:res.data})
				wx.hideLoading()
			}
		})
	},
	/**
	 * 跳转到订单详情页
	 * @param {*} e 
	 */
	orderDetail(e) {
		console.log(e.currentTarget.dataset.alphabeta);
		wx.navigateTo({
			url: '/pages/order/orderDetail/orderDetail?id='+e.currentTarget.dataset.alphabeta
		})
	}
})